import request from '@/request'

export function getAllTags(page) {
  return request({
    url: '/tags',
    method: 'get',
    params: {
      current: page.pageNumber,
      size: page.pageSize,
    }
  })
}

export function getAllTagsDetail(page) {
  return request({
    url: '/tags/detail',
    method: 'get',
    params: {
      current: page.pageNumber,
      size: page.pageSize,
    }
  })
}

export function getHotTags(size) {
  return request({
    url: '/tags/hot',
    method: 'get',
    params: {
      limit: size
    }
  })
}

export function getTag(id) {
  return request({
    url: `/tags/${id}`,
    method: 'get',
  })
}

export function getTagDetail(id) {
  return request({
    url: `/tags/detail/${id}`,
    method: 'get',
  })
}

export function getTagNameLike(name, page) {
  return request({
    url: `/tags/name/like`,
    method: 'get',
    params: {
      name: name,
      current: page.pageNumber,
      size: page.pageSize,
    }
  })
}
